package oppsa.view;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import oppsa.controller.Translate;

public class MailSentDialog extends JDialog {

	private final JPanel contentPanel = new JPanel();
	private Translate t = new Translate();

	/**
	 * Create the dialog.
	 */
	public MailSentDialog(String mail) {
		setBounds(100, 100, 365, 110);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);

			
		JLabel lblSentMail = new JLabel(t.getLocalizedText("mailsent")+ " : "+ mail );
		lblSentMail.setBounds(10, 0, 265, 31);
		contentPanel.add(lblSentMail);

		JButton okButton = new JButton("OK");
		okButton.setBounds(141, 42, 47, 23);
		contentPanel.add(okButton);
		okButton.setActionCommand("OK");
		getRootPane().setDefaultButton(okButton);

		JPanel buttonPane = new JPanel();
		getContentPane().add(buttonPane, BorderLayout.SOUTH);
		buttonPane.setLayout(null);

		
		okButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
	}

	/**
	 * @wbp.parser.constructor
	 */
	public MailSentDialog(boolean b) {
		setBounds(100, 100, 365, 110);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setLayout(null);

			
		JLabel lblSentMail = new JLabel(t.getLocalizedText("saisilogin"));
		lblSentMail.setBounds(10, 0, 265, 31);
		contentPanel.add(lblSentMail);

		JButton okButton = new JButton("OK");
		okButton.setBounds(141, 42, 47, 23);
		contentPanel.add(okButton);
		okButton.setActionCommand("OK");
		getRootPane().setDefaultButton(okButton);

		JPanel buttonPane = new JPanel();
		getContentPane().add(buttonPane, BorderLayout.SOUTH);
		buttonPane.setLayout(null);

		
		okButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
	}

}
